package com.pucong.gitee.database.backup.common.entity.sys;

import com.pucong.gitee.database.backup.common.selfenum.UserStatusEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
* @author pucong
* @company gitee.com/pucong
* @create 2020-12-01
*/
@Data
@ApiModel("用户保存实体类")
public class UserJwt implements Serializable {

    private static final long serialVersionUID = 1L;

    public UserJwt (){
    }

    public UserJwt (SysUserInfo user){
        this.uuid = user.getUuid();
        this.loginName = user.getLoginName();
        this.userName = user.getUserName();
        this.status = user.getStatus();
        this.createTime = user.getCreateTime();
        this.createBy = user.getCreateBy();
    }

    @ApiModelProperty("主键")
    private String uuid;

    @ApiModelProperty("账号")
    private String loginName;

    @ApiModelProperty("姓名")
    private String userName;

    @ApiModelProperty("0删除 /1正常 / 2锁定 / 3过期")
    private UserStatusEnum status;

    @ApiModelProperty("上次登录时间")
    private Date lastLoginTime;

    @ApiModelProperty("创建")
    private Date createTime;

    @ApiModelProperty("创建人id")
    private String createBy;

    @ApiModelProperty("用户token")
    private String token;
}
